<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>课程信息</title>
    <style>
        /* 全局样式 */
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f4f4f9;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        /* 容器样式 */
        .course-info {
            background-color: #fff;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
            text-align: left;
        }

        /* 标题样式 */
        .course-info h1 {
            text-align: center;
            color: #333;
            margin-bottom: 20px;
            font-size: 24px;
            font-weight: bold;
        }

        /* 段落样式 */
        .course-info p {
            margin: 15px 0;
            font-size: 16px;
            color: #555;
        }

        /* 强调文本样式 */
        .course-info p strong {
            color: #333;
            font-weight: bold;
        }

        /* 错误信息样式 */
        .error {
            color: #ff4d4d;
            text-align: center;
            font-size: 16px;
            margin-top: 20px;
        }

        /* 按钮样式 */
        .back-button {
            display: block;
            width: 100%;
            padding: 10px;
            background-color: #007bff;
            color: #fff;
            border: none;
            border-radius: 5px;
            font-size: 16px;
            cursor: pointer;
            text-align: center;
            text-decoration: none;
            margin-top: 20px;
            transition: background-color 0.3s ease;
        }

        .back-button:hover {
            background-color: #0056b3;
        }
    </style>
</head>
<body>
    <div class="course-info">
        <h1>课程信息</h1>
        {% if error %}
            <p class="error">{{ error }}</p>
        {% elif course %}
            <p><strong>课程编号:</strong> {{ course.cid }}</p>
            <p><strong>课程名:</strong> {{ course.cname }}</p>
            <p><strong>课时:</strong> {{ course.hour }}</p>
        {% else %}
            <p class="error">未找到该课程</p>
        {% endif %}
        <a href="/" class="back-button">返回</a>
    </div>
</body>
</html>